﻿using System;
using System.Data;
using System.Linq;
using System.Windows;
using WPFExcelReport.Chart;
using System.Windows.Controls;
using WPFExcelReport.Helpers;
using System.ComponentModel;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for EditEventWindow.xaml
    /// </summary>
    public partial class TSTVKPOS
    {
        public TSTVKPOS()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VVKPOS();
            this.DataContext = MV;
            MESSAGES += "VKKNEW;VVRELOAD;VVTCHG;VKPCHK;WDCHG;";
            InitializeComponent();
            VKPSA = "  ";
        }
        /// <summary>
        /// TST
        /// 就会执行更多的内容
        /// </summary>
        /// <param name="dwData"></param>
        public override void CheckPrice(DataRow dwData)
        {
            CHKTSTPRICE(dwData);
            base.CheckPrice(dwData);
        }
        public void CHKTSTPRICE(DataRow dwData)
        {

            if (dwVF != null)
            {
                string PR = dwVF["VAAARTWEB"].ToString();
                string CURRENCY = PR.Substring(8, 3);
                string PRMEEH = PR.Substring(12, 3);
                string WSPRICE = PR.Substring(0, 8);
                if (WSPRICE.Trim() == "")
                {
                    return;
                }
                dwData["VKPPREIS"] = Helper.Right("0000000000" + (System.Convert.ToDouble(WSPRICE) * 1000).ToString(), 10);
                dwData["VKPMEEH"] = PRMEEH;
                if (dwData.Table.Columns.Contains("LSLIEFNA")
                    && dwVF.Table.Columns.Contains("LSLIEFNA"))
                {

                    dwData["LSLIEFNA"] = dwVF["LSLIEFNA"].ToString();
                }

                MEEH = "";
                MEEH = PRMEEH;
                //dwData["VKPPREIS"] = 
            }
        }
    } 
}
